﻿namespace RuoVea.Notes.Server.Models;

/// <summary>
/// 笔记与标签关联
/// </summary>
[SugarTable(nameof(NtNoteTag), "笔记与标签关联")]
public class NtNoteTag : EntityBaseId
{
    /// <summary>
    /// 笔记ID
    /// </summary>
    [SugarColumn(ColumnDescription = "笔记ID")]
    public long NoteId { get; set; }

    /// <summary>
    /// 标签ID
    /// </summary>
    [SugarColumn(ColumnDescription = "标签ID")]
    public long TagId { get; set; }

    /// <summary>
    /// 笔记
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    public NtNote Note { get; set; }

    /// <summary>
    /// 标签
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    [Navigate(NavigateType.OneToMany, nameof(NtTag.Id), nameof(TagId))]
    public NtTag Tag { get; set; }
}
